package game.state;

import engine.Displays;
import math.Maths;

public class GameState 
{
    
    public static final int FALSE = 0xEE;
    public static final int TITLE_MENU = 0xEF;
    public static final int GAMEPLAY = 0xF0;
    
    protected Displays display;
    
    protected int movingOn;
    public int nextState() 
    {
        return movingOn;
    }
    
    public GameState(Displays _display) 
    {
        movingOn = FALSE;
        display = _display;
    }
    
    public void reset() 
    {
        movingOn = FALSE;
    }
    
    public boolean isMovingOn() 
    {
        return (movingOn != FALSE);
    }
    
    protected int getScaledX(int xpos) 
    {
        return Maths.nearestInt((((float)xpos)*Maths.ONE_OVER_1680) * display.currentW());
    }
    
    protected int getScaledY(int ypos) 
    {
        return Maths.nearestInt((((float)ypos)*Maths.ONE_OVER_1050) * display.currentH());
    }
    
    protected int getRasterH(int num) 
    {
        return (display.currentH() - 20 - 14 * num);
    }
    
}
